package com.brainhealth.common.utils;

import cn.hutool.core.convert.Convert;

import java.util.Arrays;
import java.util.List;

/**
 * @author wll
 * Long 类型工具
 */
public class LongUtils {

    /**
     * 将string 集合转为long
     *
     * @param list
     * @return
     */
    public static Long[] string2LongArr(List<String> list) {
        String[] recordIdArr = list.toArray(new String[list.size()]);
        Long[] longArr = Convert.toLongArray(recordIdArr);
        return longArr;
    }

    public static List<Long> string2LongList(List<String> list) {
        String[] recordIdArr = list.toArray(new String[list.size()]);
        Long[] longArr = Convert.toLongArray(recordIdArr);
        List<Long> longList = Arrays.asList(longArr);
        return longList;
    }

}
